/* eslint-disable prefer-rest-params */
/* eslint-disable no-undef */
(function (para) {
	var p = para.sdk_url,
		n = para.name,
		w = window,
		d = document,
		s = 'script',
		x = null,
		y = null;
	w.sensorsDataAnalytic201505 = n;
	w[n] = w[n] || function (a) {
		return function () {
			(w[n]._q = w[n]._q || []).push([a, arguments]);
		};
	};
	var ifs = [
		'track',
		'quick',
		'register',
		'registerPage',
		'registerOnce',
		'clearAllRegister',
		'trackSignup',
		'trackAbtest',
		'setProfile',
		'setOnceProfile',
		'appendProfile',
		'incrementProfile',
		'deleteProfile',
		'unsetProfile',
		'identify',
		'login',
		'logout',
		'trackLink',
		'clearAllRegister'
	];
	var i = 0;
	for (; i < ifs.length; i++) {
		w[n][ifs[i]] = w[n].call(null, ifs[i]);
	}
	if (!w[n]._t) {
		x = d.createElement(s);
		y = d.getElementsByTagName(s)[0];
		x.async = 1;
		x.src = p;
		y.parentNode.insertBefore(x, y);
		w[n].para = para;
	}
})({
	'sdk_url': '//m.ppdaicdn.com/act/huan/js/sensorsdata.min.js?v=1',
	'name': 'sa',
	'server_url': ~location.search.indexOf('sensors=debug')
		? 'https://sensorsdata.ppdai.com/sa/?project=default'
		: 'https://sensorsdata.ppdai.com/sa/?project=production'
});
sa.registerPage({
	'product': 'other',
	'platform': 'H5',
	'product_h5': 'hh_h5',
	'h5_channel': '',
	'user_agent': window.navigator.userAgent,
	'source': (new RegExp('\\?(?:.+(?:&|=))?source=([^&#]*)(?:&|#|$)').exec(location.search) || [])[1] || ''
});
sa.quick('autoTrack');
